import request from '@/utils/request'

//注册接口
export const UserRegisterService = ({ username, password, repassword }) => {
  return request.post('/api/reg', { username, password, repassword })
}
export const UserLoginService = ({ username, password }) => {
  return request.post('/api/login', { username, password })
}
export const UserGetInfoService = () => {
  return request.get('/my/userinfo')
}

export const userUpdateInfoService = ({ id, nickname, email }) => {
  return request.put('/my/userinfo', { id, nickname, email })
}
export const userUploadAvatarService = (avatar) => {
  return request.patch('/my/update/avatar', { avatar })
}
export const userUpldatePassSrevice = ({ old_pwd, new_pwd, re_pwd }) => {
  return request.patch('/my/updatepwd', { old_pwd, new_pwd, re_pwd })
}
